
{block name="css"}

<link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui/css/H-ui.min.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/css/H-ui.admin.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/lib/Hui-iconfont/1.0.8/iconfont.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/hui/static/h-ui.admin/skin/default/skin.css" id="skin"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/common.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/app.css"/>

{CSS href="__STATIC__/w/admin_base.css" /}
{CSS href="__STATIC__/w/laydate.css" /}
{CSS href="__STATIC__/w/layui.css" /}
{CSS href="__STATIC__/w/divtable.css" /}
{/block}

{block name="js"}
{js href='__STATIC__/w/jquery1110min.js' /}
{js href='__STATIC__/w/layui.js' /}
{/block}


{block name="main"}

<nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 微信会话用户
    <a class="btn radius btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a>
</nav>

<div class="layui-form-cont">

    <form class="layui-form" id="form" name="" method="post" action="{:\\think\\Url::build(\'dolistsave\')}">

        <div class="layui-form-title form-title-withe">

            <span>
                <a class="layui-btn radius layui-btn-normal" href="{:url(\''.\\think\\Request::instance()->controller().'/index',['status'=>0])}">
                    <i class="layui-icon">&#xe667;</i>未阅
                </a>
            </span>

            <span>
                <a class="layui-btn" href="{:url(\''.\\think\\Request::instance()->controller().'/index',['status'=>1])}">
                    <i class="layui-icon">&#xe605;</i>已阅
                </a>
            </span>

            <span style="display: none">
                <input name="inputtype" id="style" value="" type="hidden"/>
                <button class="layui-btn radius layui-btn-danger" name="del" onclick="test(this)"><i class="layui-icon">&#x1006;</i> 删除</button>
            </span>

            <span style="float: right;color: #000;">
                <div class="layui-btn radius layui-btn-primary"><i class="layui-icon">&#xe63a;</i> 信息：<strong>{$num|default="0"}</strong></div>
            </span>

        </div>

        <div class="mt-10">

            <table class="layui-table w-table-message" lay-skin="line" style="margin-top: 0;">
                <thead>
                    <tr>
                        <th><input name="" lay-skin="primary" lay-filter="allChoose" type="checkbox"></th>
                        <th width="80">头像</th>
                        <th>昵称</th>
                        <th>地区</th>
                        <th>状态</th>
                        <th>时间</th>
                        <th>操作</th>
                    </tr>
                </thead>

                <tbody>
                    {volist name="list" id="vo" empty="$_html_empty"}
                    <tr>
                        <td>
                            <input name="id[]" type="checkbox" lay-skin="primary" value="{$vo.openid}" >
                        </td>

                        <td>
                            <div class="message-headimg">
                                <img class="form_logo" alt="{$vo.nickname}" src="{$vo.headimgurl}" width="80" height="80">
                            </div>
                        </td>
                        <td>{$vo.nickname}</td>
                        <td>{$vo.province}-{$vo.city}</td>
                        <td>{$vo.status|check}</td>
                        <td>{$vo.create_time}</td>
                        <td>
                            <a style="text-decoration:none" class="btn radius btn-xs btn-warning" href="{:url(\''.\\think\\Request::instance()->controller().'/read',['id'=>$vo.id])}" title="回复">回复</a>
                        </td>
                    </tr>
                    {/volist}
                </tbody>
            </table>

        </div>
    </form>
    {$list->render()}

</div>

<script>
    layui.use('form', function(){
        var $ = layui.jquery, form = layui.form;

        //全选
        form.on('checkbox(allChoose)', function(data){
            var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
            child.each(function(index, item){
                item.checked = data.elem.checked;
            });
            form.render('checkbox');
        });
    });

    $('#synselect').click(function () {
        var openids=[];
        $("input[name='id[]']:checked").each(function (key,value) {
            openids[key]=$(this).val();
        })
        $.post("{:url('SynSelect')}",{'openids':openids},function (result) {
            layer.alert(result.msg, {
                closeBtn: 0
            });
        })
    })
</script>

{/block}